home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
bg.arc
/
BG.DOC
next >
Wrap
Text File
|
1985-04-03
|
8KB
|
202 lines
DESCRIPTION:
The command with which to invoke BG is:-
BG [[d:]afn.ft] [options]
BG generates a file call NAMES.BAT. It uses the command
line to obtain the filename.filetype search mask (afn.ft
portion) and also some optional run time parameters.
These parameters are used to select the file names off
of the specified disk. These selected file names are then
sorted into ascending sequence and the user is notified of
how many files are selected.
At this point a prompt 'Skeleton?' is displayed asking
for skeleton line(s) into which the selected file names
will be inserted. More than one skeleton line can be given
in which case multiple lines are generated for each file
name. A null line terminates the skeleton line input phase
of the programs operation.
Obviously, part of the skeleton can be commands that
operate on the file names. Alternatively, BATCH parameters
can be included at various points within the skeleton if
it is necessary to generate a multi-use .BAT file.
SUBSTITUTION FORMULA:
During the generation of the .BAT file from the selected
file names BG copies the skeleton line(s) to the output
file once for every selected name. During this copying
process BG looks for occurrences of the substitution
character. When found, BG replaces this character with the
current filename.filetype. The standard character is
the '@' character
Special processing is done by BG if the @ character
is preceded or followed by a period. This is to allow
for the possibility of doing global operations on
filetypes or on systems. The algorithm is most easily
explained by use of examples. Assume that the current
file name is ABC.COM. Thus:-
erase @ => erase ABC.COM ;simple case first
erase b:@ => erase b:ABC.COM ;another simple case
rename @ @.old => rename ABC.COM ABC.old
; . suffix causes fn
substitution only
dir *.@ => dir * ; . prefix causes ft
; substitution only
A secondary substitution character has been provided
that functions just as above with one exception, when
selecting only fn or ft by specification of a period
before or after the substitution character, a leading
or trailing period is not written to the output file.
The standard secondary substitution character is the '#'.
Expanding upon the above example, we have:
testpgm #. => testpgm ABC ; no trailing period
type # => type ABC.CO ; identical to standard
; substitution character
; if no leading or
; trailing period
OPTIONAL EXTRAS:
The following options can follow the file name specification
if these additional capabilities are desired:
(F) This option allows specification of an output file name
following the options prompt. If this option is not
used, the default output file name is NAMES.BAT.
(H) This causes a Header? prompt to be written. It is
used to write one or more records to the output file
before the body of the file is written using the
skeleton definitions. No file name substitution takes
place on these header records. A null reply
terminates the header record writing process.
(L) This option is used to convert all file names to lower
case before substitution into the skeleton lines. This
option is very useful with the C86 librarian and
linker, as they are a bit confused about the case of
file names. i.e. The librarian is case sensitive, but
the linker is not.
(P) This causes the selected filenames to be written
followed by a question mark (?) during the selection
process. This occurs after selection, i.e. you have
the last say. A Y response selects the file while an N
response rejects the file. In addition, a B response
backs up one entry in the list, a S response skips the
rest of the list, and a Q response immediately aborts
BG.
(T) Similar to the Header option, the trailer option
allows one or more records to be written after the body
of the file.
HELP:
BG has a simple help function to jog your memory if you
forget how some of the parameters work, it is invoked by
typing:
BG ?
EXAMPLES:
Note: In these examples the UPPER CASE represents user
input except where obviously not user input.
1. Rename all .BAK files on the default drive to .ASM.
C>BG *.BAK Invoke BG
BG-...... Normal identifier from BG
There are 10 selected files BGs msg
Skeleton?RENAME @ @.ASM Refer to substitution rules.
Skeleton? Null reply
C>NAMES Now do the renames.
2. You are about to undertake the BG v2 project. Rename
all existing BG10.* components (DOC, REL, COM, BAT and
whatever you have forgotton about) to this new name on
the A drive.
C>BG A:BG10.* Invoke BG
BG-...... Normal identifier from BG
There are 7 selected files BGs msg
Skeleton?RENAME @ A:BG20.@ Make use of substitution
rules
Skeleton? Null reply
C>NAMES Now do the rename
3. You have to ERASE all your .BAK files on the default
drive. You wish to confirm each deletion.
C>BG *.BAK P Invoke BG with the P - option
BG-...... Normal identifier from BG
mast.bak?N BG prompt - reject reply
mast.bak?Y Select this one
.... etc
There are 2 selected files BGs msg
Skeleton?ERASE @ Generate the command
Skeleton? Null reply
C>NAMES Invoke the command.
Now, you are ready, CHARGE!